using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;

namespace NhaThuocOnline.Entities.Mapping
{
    public class ICDMap : EntityTypeConfiguration<ICD>
    {
        public ICDMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.ICDId)
                .HasMaxLength(10);

            this.Property(t => t.ICDName)
                .HasMaxLength(255);

            // Table & Column Mappings
            this.ToTable("ICD");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.ICDId).HasColumnName("ICDId");
            this.Property(t => t.ICDName).HasColumnName("ICDName");
        }
    }
}
